<!DOCTYPE html>
<html lang="zh-cn">
  <head>
    <meta charset="utf-8">
    <title>呼叫中心系统</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="/css/non-responsive.css">
    <link rel="stylesheet" type="text/css" href="/css/global.css">
    <link rel="stylesheet" type="text/css" href="/css/task.css">
  </head>
  <body>
    <nav class="navbar navbar-default navbar-static-top">
      <div class="container">
        <div class="navbar-header">
          <a class="navbar-brand" href="#"><img alt="Logo" src="/img/logo.png"></a>
          <a class="navbar-brand" href="#">呼叫中心</a>
        </div>
        <div id="navbar">
          <ul class="nav navbar-nav">
            <li class="dropdown">
            <li><a href="/status">状态监控</a></li>
            <li class="active"><a href="/task">任务管理</a></li>
            <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">座席管理</a>
              <ul class="dropdown-menu">
                <li><a href="/user">座席管理</a></li>
                <li><a href="/exten">分机状态</a></li>
              </ul>
            </li>
            <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">项目管理</a>
              <ul class="dropdown-menu">
                <li><a href="/order">订单管理</a></li>
                <li class="disabled"><a href="#">客户资料管理</a></li>
                <li><a href="/product">商品管理</a></li>
                <li><a href="/sound">语音管理</a></li>
              </ul>
            </li>
            <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">通话记录</a>
              <ul class="dropdown-menu">
                <li><a href="/cdr/query">通话记录查询</a></li>
                <li><a href="/cdr/report">通话数据报表</a></li>
              </ul>
            </li>
            <li><a href="/help">帮助文档</a></li>
          </ul>
          <ul class="nav navbar-nav navbar-right">
            <li><a><img class="img-circle icon" src="/img/<?php echo $user->icon; ?>.png" width="19" height="19"> <?php echo mb_substr($user->name, 0, 8, 'utf-8') ?></a></li>
            <li><a id="account" href="/account">我的账户</a></li>
            <li><a href="/logout"><span class="glyphicon glyphicon-log-out" aria-hidden="true"></span> 退 出</a></li>
          </ul>
        </div>
      </div>
    </nav>
    <div class="container box">
      <div>
        <ol class="breadcrumb">
          <li class="active">当前位置:</li>
          <li><a href="/task">任务管理</a></li>
          <li class="active">任务编辑</li>
        </ol>
      </div>
      <div>
        <form class="form-horizontal" action="/task/update/<?php echo $task['id']; ?>" method="post">
          <!-- 群呼转座席(自动模式) -->
          <div class="form-group">
            <label class="control-label col-sm-4">任务名称: </label>
            <div class="col-sm-3">
              <input type="text" class="form-control input-sm" style="font-weight:bold" name="name" value="<?php echo $task['name']; ?>" placeholder="请输入任务名称" required>
            </div>
            <div class="col-sm-3">
              <p class="help-block">指定任务名称</p>
            </div>
          </div>
          <div class="form-group">
            <label class="control-label col-sm-4">任务类型: </label>
            <div class="col-sm-3">
              <select class="form-control input-sm" disabled>
                <option>群呼转座席(自动)</option>
              </select>
            </div>
            <div class="col-sm-3">
              <p class="help-block">指定任务类型</p>
            </div>
          </div>
          <div class="form-group">
            <label class="control-label col-sm-4">业务模板: </label>
            <div class="col-sm-3">
              <select class="form-control input-sm" name="business">
                <option value="1"<?php if ($task['business'] == 1) {echo ' selected="selected"';} ?>>订单模板</option>
              </select>
            </div>
            <div class="col-sm-3">
              <p class="help-block">指定业务模板</p>
            </div>
          </div>
          <div class="form-group">
            <label class="control-label col-sm-4">拨号比例: </label>
            <div class="col-sm-3">
              <input type="number" class="form-control input-sm" style="font-weight:bold" name="dial" value="<?php echo $task['dial']; ?>" placeholder="请输入拨号比例" min="1" max="24" required>
            </div>
            <div class="col-sm-3">
              <p class="help-block">设置默认拨号比例,范围 1 - 24</p>
            </div>
          </div>
          <div class="form-group">
            <label class="control-label col-sm-4">语音设置: </label>
            <div class="col-sm-3">
              <select class="form-control input-sm" name="sound" required>
              <option class="text-danger" value="0"<?php if($task['play'] == '0') {echo 'selected="selected"';}?>>====== 不使用语音 =====</option>
              <?php
      		    if (is_array($sounds) && count($sounds) > 0) {
                      foreach ($sounds as $sound) {
	                if ($task['play'] == '1') {
	                  if ($task['sound'] == $sound['id']) {
	                    echo '<option value="',$sound['id'],'" selected="selected">',$sound['name'],"</option>\n";
	                  } else {
	                    echo '<option value="',$sound['id'],'">',$sound['name'],"</option>\n";
	                  }
                        } else {
                          echo '<option value="',$sound['id'],'">',$sound['name'],"</option>\n";
                        }
                      }
                    }
              ?>
              </select>
            </div>
            <div class="col-sm-3">
              <p class="help-block">指定任务语音</p>
            </div>
          </div>
          <!-- 群呼转座席(自动模式) -->

          <div class="form-group">
            <div class="col-sm-3 col-sm-offset-4">
              <button type="submit" class="btn btn-success" style="width:80px">保存修改</button>
              <a class="btn btn-default" style="margin-left:30px;width:80px" href="/task">取 消</a>
            </div>
          </div>
        </form>
      </div>
    </div>
    <script type="text/javascript" src="/js/jquery.min.js"></script>
    <script type="text/javascript" src="/js/bootstrap.min.js"></script>
    <script type="text/javascript">
      $('li.dropdown').mouseover(function() {
        $(this).addClass('open');
      }).mouseout(function() {
          $(this).removeClass('open');
      });
    </script>
  </body>
</html>
